<?php

require __DIR__ . '/../autoload.php';
date_default_timezone_set("Asia/Shanghai");
ini_set("display_errors", "On");
use \Foo\CrontabWorker;


$test = new CrontabWorker();
$test->proccessNum = 5;//预先派生进程数
$test->daemon = true; //开启守护进程
$test->output = '/tmp/test.log'; //重定向服务输出

$test->addInterval('at', '15:30', "\\Scripts\\Test::test",array("测试15:30记录信息"));
$test->addInterval('at', '00:30', "\\Scripts\\Test::test",array("测试00:30记录信息"));
$test->addInterval('at', '13:00', "\\Scripts\\Test::test",array("测试13:00记录信息"));

$test->addInterval('s', 1, "\\Scripts\\Test::test",array("测试每1秒记录信息"));
$test->addInterval('s', 2, "\\Scripts\\Test::test",array("测试每2秒记录信息"));

$test->addInterval('i', 1, "\\Scripts\\Test::test",array("测试每1分钟记录信息"));
$test->addInterval('i', 2, "\\Scripts\\Test::test",array("测试每2分钟记录信息"));

$test->addInterval('h', 1, "\\Scripts\\Test::test",array("测试每1小时记录信息"));
$test->addInterval('h', 2, "\\Scripts\\Test::test",array("测试每2小时记录信息"));

$test->run();